﻿using IdentityServer4.EntityFramework.DbContexts;
using Infrastructure.Util;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Advance.Repositories.EntityFrameworkCore
{
    public class PersistedGrantDbContextSeed
    {
        public async System.Threading.Tasks.Task SeedAsync(PersistedGrantDbContext persistedGrantDbContext, IServiceProvider services)
        {
            var grantSet = persistedGrantDbContext.PersistedGrants;
            if (!grantSet.Any())
            {
                var apiResources = Config.GetApiResources();
                var identityResources = Config.GetIdentityResources();
                //grantSet.AddRangeAsync();
                await persistedGrantDbContext.SaveChangesAsync();            }
        }
    }
}
